#!/usr/bin/env python3.9
# coding=utf-8

"""
Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved.
Description: python api test.
Author: MindX SDK
Create: 2022
History: NA
"""
import os

# 是否调试模式
DEBUG = False

# 设备ID，多个以,隔开
gpu_ids = [0, 1, 2, 3, 4, 5, 6,]
channel_id = 0
SKIP_INTERVAL = 5
BATCH_SIZE = 1
CAR_BATCH = 1
VIDEO_BATCH = 15
VIDEO_HEIGHT = 4096
VIDEO_WIDTH = 2160
VIDEO_BREAK_FRAME = 100
MAX_AGE = 5
MIN_HITS = 3
IOU_THRESHOLD = 0.3
SORT_WATI_TIME = 5
USE_NPU = True


NUM_DETECTION_PROCESS = 8
NUM_PATTERN_RECOG_PROCESS = 2
NUM_REID_PROCESS = 1
NUM_TRACK_PROCESS = 1
MODEL_NUM = NUM_DETECTION_PROCESS * 2 + NUM_PATTERN_RECOG_PROCESS * 8 + NUM_REID_PROCESS

TRACK_THRESHOLD = 2.5

# 解码列表
gpu_decode = {}

TRAFFIC_DET_MODEL_PATH = "./model/traffic/car_det_aoe2_640x640.om"
BODY_REC_MODEL_PATH = "./model/body/linewell_body_rec_v1_dy_bs.om"
BODY_REID_MODEL_PATH = "./model/body/linewell_body_reid_v2_dy_bs.om"

PORTRAIT_DET_MODEL_PATH = "./model/portrait/retinaface_r50_640x640_aoe2.om"
PORTRAIT_FEAT_MODEL_PATH = "./model/portrait/model_dy_batch.om"
PORTRAIT_QUA_BB_MODEL_PATH = "./model/portrait/linewell_face_quality_backbone_v1_dy.om"
PORTRAIT_QUA_SC_MODEL_PATH = "./model/portrait/linewell_face_quality_score_v1_dy.om"
QUALITY_SCORE_THRESHOLD = 0.01
PORTRAIL_DET_THRESHOLD = 0.5

CARUNION_REC_COLOR_MODEL_PATH = "./model/car/car-color_new_dy_bs.om"
CARUNION_REC_PROP_MODEL_PATH = "./model/car/linewell_car_class_v2_dy_bs.om"
CARUNION_REC_BRAND_MODEL_PATH = "./model/car/car_brand_cls_bs1.om"

CARPLATE_DET_MODEL_PATH = "./model/traffic/car_plate_det_aoe2_640x640.om"
CARPLATE_REC_MODEL_PATH = "./model/car/inference_rec_dy_bs.om"

KAFKA_URL = "35.96.8.244:9092"
KAFKA_FACE_TOPIC = "ruiyuan_face"
KAFKA_BODY_TOPIC = "ruiyuan_body"
KAFKA_CAR_TOPIC = "ruiyuan_car"
KAFKA_MOTOR_TOPIC = "ruiyuan_motor"
os.environ.setdefault("KAFKA_URL", KAFKA_URL)

UPLOAD_PATH = "/data/images"
NGINX_URL = "http://35.96.8.241:8090/images"

MODEL_CAR_COLOR_LABEL = ['黑色', '白色', '灰色', '银色', '蓝色', '红色', '绿色', '棕色', '米色', '金色', '枣红色', '黄色', '紫色', '橙色',]
MODEL_CAR_CLASS_LABEL = ['大客车', '大货车', '小客车', '小货车', '小轿车']
MODEL_CAR_BRAND_LABEL = ['三菱_劲炫', '三菱_翼神', '东南_DX7', '东南_V3菱悦', '东南_V5菱致', '丰田_RAV4荣放', '丰田_卡罗拉', '丰田_埃尔法', '丰田_汉兰达', '丰田_花冠', '五菱_五菱宏光', '五菱_征程', '五菱_荣光', '五菱_鸿途', '众泰_2008', '众泰_T600', '众泰_Z300', '别克_君威', '别克_君越', '别克_威朗', '别克_昂科拉', '力帆_320', '力帆_520', '力帆_620', '北京_BJ20', '北京_BJ40', '北京_BJ80', '吉利_博瑞', '吉利_博越', '吉利_帝豪', '吉普_指南者', '吉普_牧马人', '大众_Polo', '大众_宝来', '大众_帕萨特', '大众_捷达', '大众_朗逸', '大众_桑塔纳', '大众_甲壳虫', '大众_辉腾', '大众_速腾', '大众_高尔夫', '奇瑞_E3', '奇瑞_E5', '奇瑞_QQ', '奇瑞_QQ3', '奇瑞_QQ6', '奇瑞_瑞虎7', '奇瑞_艾瑞泽5', '奔驰_A级', '奔驰_E300', '奔驰_GLA', '奔驰_GLC', '奔驰_S350', '奥迪_A3', '奥迪_A4L', '奥迪_A5', '奥迪_A6L', '奥迪_Q3', '奥迪_Q5', '宝马_525', '宝马_740', '宝骏_310', '宝骏_560', '宝骏_730', '广汽传祺_传祺GS4', '广汽传祺_传祺GS8', '斯柯达_明锐', '斯柯达_晶锐', '斯柯达_速派', '日产_D22', '日产_NV200', '日产_帕拉丁', '日产_颐达', '昌河_Q35', '昌河_福瑞达', '本田_CR-V', '本田_XR-V', '本田_奥德赛', '本田_思域', '本田_杰德', '本田_缤智', '本田_锋范', '本田_雅阁', '本田_飞度', '标致_2008', '标致_206', '标致_308', '比亚迪_宋', '比亚迪_秦', '江淮_瑞风M3', '江淮_瑞风M5', '江淮_瑞风S3', '江铃_域虎7', '江铃_宝典', '江铃_宝威', '沃尔沃_S40', '沃尔沃_S60', '沃尔沃_XC60', '海马_海福星', '海马_海马3', '海马_海马M6', '猎豹_飞扬', '猎豹_飞铃', '猎豹_黑金刚', '现代_IX35', '现代_伊兰特', '福特_嘉年华', '福特_探险者', '福特_撼路者', '福特_福克斯', '福特_福睿斯', '福特_蒙迪欧', '福特_锐界', '福田_图雅诺', '福田_拓陆者', '福田_风景G7', '福迪_小超人', '福迪_揽福', '福迪_雄师F22', '红旗_H7', '荣威_350', '荣威_360', '菲亚特_派力奥', '菲亚特_菲翔', '起亚_K3', '起亚_K5凯酷', '起亚_智跑', '路虎_发现', '路虎_揽胜', '路虎_揽胜运动版', '金杯_大海狮', '金杯_小海狮X30', '金杯_海狮', '长城_C20R', '长城_C30', '长城_哈弗H1', '长城_哈弗H2', '长城_哈弗H6', '长城_风骏5', '长安_CS15', '长安_CS75', '长安_逸动', '雪佛兰_创酷', '雪佛兰_科帕奇', '雪佛兰_科沃兹', '雪佛兰_科鲁兹', '雪佛兰_迈锐宝XL', '雪铁龙_C3XR', '雪铁龙_C5', '雪铁龙_C6', '雷克萨斯_ES', '雷克萨斯_GS', '雷克萨斯_LS', '马自达_CX5', '马自达_睿翼', '马自达_阿特兹', '马自达_马自达3', '马自达_马自达3昂克赛拉', '马自达_马自达3星骋']
MODEL_BODY_LABEL = ['性别-男', '性别-女', '年龄-青年', '年龄-中年', '年龄-小孩', '年龄-老年', '头发长度-短发', '头发长度-披肩', '头发长度-盘发', '头发长度-全秃', '头发长度-额秃', '发型-平头', '发型-偏分', '发型-中分', '卷发-是', '帽子款式-棒球帽', '帽子款式-平顶帽', '帽子款式-渔夫帽', '帽子款式-套头帽', '帽子款式-鸭舌帽', '帽子款式-安全帽', '帽子颜色-黑', '帽子颜色-白', '帽子颜色-灰', '帽子颜色-红', '帽子颜色-蓝', '帽子颜色-黄', '帽子颜色-橙', '帽子颜色-棕', '帽子颜色-绿', '帽子颜色-紫', '帽子颜色-青', '帽子颜色-粉', '戴口罩-是', '戴眼镜-是', '上衣颜色-黑', '上衣颜色-白', '上衣颜色-灰', '上衣颜色-红', '上衣颜色-蓝', '上衣颜色-黄', '上衣颜色-橙', '上衣颜色-棕', '上衣颜色-绿', '上衣颜色-紫', '上衣颜色-青', '上衣颜色-粉', '上衣长度-短袖', '上衣长度-长袖', '上衣长度-中袖', '上衣长度-无袖', '上衣纹理-纯色', '上衣纹理-条纹', '上衣纹理-格子', '上衣纹理-花纹', '下身颜色-黑', '下身颜色-白', '下身颜色-灰', '下身颜色-红', '下身颜色-蓝', '下身颜色-黄', '下身颜色-橙', '下身颜色-棕', '下身颜色-绿', '下身颜色-紫', '下身颜色-青', '下身颜色-粉', '下身长度-长裤', '下身长度-短裤', '下身长度-中裤', '下身长度-长裙', '下身长度-短裙', '下身长度-中裙', '手推车-是', '抱小孩-是', '打伞-是', '手拉箱-是', '手拉箱颜色-黑', '手拉箱颜色-白', '手拉箱颜色-灰', '手拉箱颜色-红', '手拉箱颜色-蓝', '手拉箱颜色-黄', '手拉箱颜色-橙', '手拉箱颜色-棕', '手拉箱颜色-绿', '手拉箱颜色-紫', '手拉箱颜色-青', '手拉箱颜色-粉', '单肩包-是', '单肩包颜色-黑', '单肩包颜色-白', '单肩包颜色-灰', '单肩包颜色-红', '单肩包颜色-蓝', '单肩包颜色-黄', '单肩包颜色-橙', '单肩包颜色-棕', '单肩包颜色-绿', '单肩包颜色-紫', '单肩包颜色-青', '单肩包颜色-粉', '手提包-是', '手提包颜色-黑', '手提包颜色-白', '手提包颜色-灰', '手提包颜色-红', '手提包颜色-蓝', '手提包颜色-黄', '手提包颜色-橙', '手提包颜色-棕', '手提包颜色-绿', '手提包颜色-紫', '手提包颜色-青', '手提包颜色-粉', '手提包颜色-透明', '双肩包-是', '双肩包颜色-黑', '双肩包颜色-白', '双肩包颜色-灰', '双肩包颜色-红', '双肩包颜色-蓝', '双肩包颜色-黄', '双肩包颜色-橙', '双肩包颜色-棕', '双肩包颜色-绿', '双肩包颜色-紫', '双肩包颜色-青', '双肩包颜色-粉', '斜挎包-是', '斜挎包颜色-黑', '斜挎包颜色-白', '斜挎包颜色-灰', '斜挎包颜色-红', '斜挎包颜色-蓝', '斜挎包颜色-黄', '斜挎包颜色-橙', '斜挎包颜色-棕', '斜挎包颜色-绿', '斜挎包颜色-紫', '斜挎包颜色-青', '斜挎包颜色-粉',]


MODELING_SERVER_PORT = 5080  # 建模服务端口

# 检测模型地址
DETECTOR_MODEL_NAME = ''

# 属性识别模型地址
RECOGNIZER_MODEL_NAME = ''

# 行人重识别模型地址
REID_MODEL_NAME = ''

# GPU id， 多个gpu按逗号分隔 '0,1'
GPUS = os.getenv('GPUS', '0')

MODELING_GPU_PARALLELISM = int(os.getenv('GPU-PARALLELISM', 1))  # 每个GPU开几个进程

MODELING_BATCH_SIZE = int(os.getenv('BATCH-SIZE', 20))  # 图片批次处理大小

# 模式，linwell：测试环境, nanan: 南安, jinjiang: 晋江
MODE = 'paodian'

# 队列最大容量，超过时清空队列避免服务器死机
MAX_QUEUE_SIZE = 1000
os.environ.setdefault("MAX_QUEUE_SIZE", str(MAX_QUEUE_SIZE))
